package ru.jexp.rcp.supply.actions.wizards;

import org.eclipse.jface.action.Action;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.ui.IWorkbenchWindow;

import ru.jexp.rcp.supply.beans.nakl.NewWizardNakl;
import ru.jexp.rcp.supply.img.JExpImageLink;
import ru.jexp.rcp.supply.mui.JExpSupplyMessages;

public class ActionNewWizardNakl extends Action {

	public static final String ID = "ru.jexp.rcp.supply.actions.wizards.actionnewwizardnakl";

	private IWorkbenchWindow window;

	public ActionNewWizardNakl(IWorkbenchWindow window) {
		super(JExpSupplyMessages.Nakl_wizard_action_text);
		this.window = window;
		setId(ID);
		setActionDefinitionId(ID);
		setText(JExpSupplyMessages.Nakl_wizard_action_text);
		setToolTipText(JExpSupplyMessages.Nakl_wizard_action_tooltip);
		setImageDescriptor(JExpImageLink.getImageDescriptor(JExpImageLink.NAKL));
	}

	@Override
	public void run() {
		NewWizardNakl wizard = new NewWizardNakl();
		wizard.init(window.getWorkbench(), null);
		WizardDialog wd = new WizardDialog(window.getShell(), wizard);
		wd.open();
	}

}
